ptrace.h, traps.c:
Fix ring privilege checking in Xenolinux (OS runs in ring 1, not ring 0).
/* If this is a kernel mode trap, save the user PC on entry to
* the kernel, that's what the debugger can make sense of.
*/
- info.si_addr = ((regs->xcs & 3) == 0) ? (void *)tsk->thread.eip :
+ info.si_addr = ((regs->xcs & 2) == 0) ? (void *)tsk->thread.eip :
(void *)regs->eip;
force_sig_info(SIGTRAP, &info, tsk);
#define PTRACE_O_TRACESYSGOOD 0x00000001
#ifdef __KERNEL__
-#define user_mode(regs) ((regs) && (3 & (regs)->xcs))
+#define user_mode(regs) ((regs) && (2 & (regs)->xcs))
#define instruction_pointer(regs) ((regs) ? (regs)->eip : NULL)
extern void show_regs(struct pt_regs *);
#endif